package com.lmk.t02;

public class Run implements Runnable {

    Integer miller=1000;

    @Override
    public void run() {
    while (true){
        if(miller<=100){
            break;
        }
        go();
        return;
    }
    }
    public synchronized void go(){
        System.out.println(Thread.currentThread().getName()+"号选手拿到了接力棒");
        for (int i = 0; i <100 ; i+=10) {
            try {
                Thread.sleep(10);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName()+"号选手跑了"+(i+10)+"米");

        }
        miller+=100;
    }
}
